이 페이지에서는 FreeCAD를 시작하는 다양한 방법과 가장 중요한 구성 기능을 보여줍니다.
FreeCAD는 데스크탑 아이콘을 두 번 클릭하거나 시작 메뉴에서 선택하여 정상적으로 시작할 수 있지만 명령줄에서 직접 시작할 수도 있습니다.이를 통해 기본 시작 옵션 중 일부를 변경할 수 있습니다.
명령줄 옵션은 자주 변경됩니다. 따라서 다음을 입력하여 현재 옵션을 확인하는 것이 좋습니다.
FreeCAD --help
응답에서 가능한 매개변수를 읽을 수 있습니다.
Usage: FreeCAD [options] File1 File2 ... Allowed options: Generic options: -v [ --version ] Prints version string --verbose Prints verbose version string -h [ --help ] Prints help message -c [ --console ] Starts in console mode --response-file arg Can be specified with '@name', too --dump-config Dumps configuration --get-config arg Prints the value of the requested configuration key --set-config arg Sets the value of a configuration key --keep-deprecated-paths If set then config files are kept on the old location Configuration: -l [ --write-log ] Writes FreeCAD.log to the user directory. --log-file arg Unlike --write-log this allows logging to an arbitrary file -u [ --user-cfg ] arg User config file to load/save user settings -s [ --system-cfg ] arg System config file to load/save system settings -t [ --run-test ] arg Run a given test case (use 0 (zero) to run all tests). If no argument is provided then return list of all available tests. -r [ --run-open ] arg Run a given test case (use 0 (zero) to run all tests). If no argument is provided then return list of all available tests. Keeps UI open after test(s) complete. -M [ --module-path ] arg Additional module paths -P [ --python-path ] arg Additional python paths --single-instance Allow to run a single instance of the application --safe-mode Force enable safe mode --pass arg Ignores the following arguments and pass them through to be used by a script
다음 표에서는 선택한 옵션에 대해 자세히 설명합니다.
Long option | Corresponding config var name | Synopsis |
---|---|---|
--user-cfg <filename> |
UserParameter | Filename or relative path that ends with a filename. Defaults to user.cfg .
|
--module-path <dir> |
Prepends to AdditionalModulePaths | Directory that contains modules. This option can be given repeatedly to specify multiple directories. |
--get-config <config-var-name> |
most | Outputs the requested value in a popup dialog. Exits upon confirmation with OK. Cannot be used repeatedly. If an unknown/illegal variable name is used, the response is empty. The --console flag is not honored.
|
Options can written in two forms: --long-option arg
and --long-option=arg
.
FreeCAD can read some of these options from a config file. This file must be in the bin path and must be named FreeCAD.cfg. Be aware that options specified in the command line override the config file!
Some operating systems have a very low limit of characters on the command line. The common way to work around those limitations is using response files. A response file is just a configuration file which uses the same syntax as the command line. If the command line specifies a response file, it's loaded and parsed in addition to the command line:
FreeCAD @ResponseFile.txt
or:
FreeCAD --response-file=ResponseFile.txt
or:
FreeCAD --response-file ResponseFile.txt
There are a couple of options not visible to the user. These options are e.g. the X-Window parameters parsed by the Windows system:
FreeCAD is usually built with two executables: a GUI-capable one called FreeCAD or freecad, and a headless one, called FreeCADCmd or freecadcmd.
FreeCAD can be used in console mode using the --console
switch (which is the default behavior of FreeCADCmd):
FreeCAD --console
In console mode, no graphical user interface will be displayed, and you will be presented with a Python interpreter prompt: >>>
. From that prompt, you have the same functionality as the Python interpreter that runs inside the FreeCAD GUI, and access to all modules and plugins of FreeCAD, except the FreeCADGui module. Be aware that modules that depend on FreeCADGui might also be unavailable.
To read more about console or headless mode, refer to Headless FreeCAD.
File type | System | Command line example |
---|---|---|
Module | Windows | "C:\Program Files\FreeCAD\bin\FreeCAD.exe" -M "C:\FreeCAD\Mod\Draft"
|
Linux | FreeCAD_0.19 -M ~/.FreeCAD/Mod/Draft
| |
Linux (AppImage) | path/to/FreeCADXXX.AppImage -M ~/.FreeCAD/Mod/Draft
| |
.FCMacro or .py | Windows | "C:\Program Files\FreeCAD\bin\FreeCAD.exe" "C:\Users\userName\AppData\Roaming\FreeCAD\Mod\WorkFeature\start_WF.FCMacro"
|
Linux | FreeCAD_0.19 ~/.FreeCAD/Mod/WorkFeature/start_WF.FCMacro
| |
Linux (AppImage) | path/to/FreeCADXXX.AppImage ~/.FreeCAD/Mod/WorkFeature/start_WF.FCMacro
|
See Macro at Startup on how to set up a macro to automatically run at FreeCAD startup.
FreeCAD supports the following environment variables, which can be used to configure directories: introduced in version 0.19
Environment variable | Corresponding config var name | Synopsis |
---|---|---|
FREECAD_USER_HOME |
UserHomePath | FreeCAD's "base" directory for keeping local user data. |
FREECAD_USER_DATA |
UserAppData | If not set, defaults to FREECAD_USER_HOME/.FreeCAD , but only if FREECAD_USER_HOME is set.
|
FREECAD_USER_TEMP |
AppTempPath | If not set, defaults to FREECAD_USER_HOME/temp , but only if FREECAD_USER_HOME is set.
|
If the specified path does not exist, the setting is ignored!
The above environment variables are meant to be used to realize a portable FreeCAD environment. For an example how environment variables can be used from the command line on Linux refer to the notes for Linux users on the downloads page.
HOME
FreeCAD uses Qt, which does honor the HOME
environmental variable. Thus, setting HOME
can be used to specify the base directory of Qt-related configuration files (.config/FreeCAD/FreeCAD.conf
).
FreeCad itself does not honor the HOME
environmental variable (because it determines the user's home directory from a lower-level system API). Use FREECAD_USER_HOME
for this pupose.
TMPDIR
The default temporary directory is /tmp/. The TMPDIR
environmental variable can be used to override the default. (Editor: precedence?).
Some libraries need to call system environment variables. Sometimes when there is a problem with a FreeCAD installation, it is because some environment variable is absent or incorrect. Therefore, some important variables get duplicated in the Config and saved in the log file.
Python
OpenCascade
On every startup FreeCAD examines its surrounding and the command line parameters. It builds up a configuration set which holds the essence of the runtime information. This information is later used to determine the place where to save user data or log files. It is also very important for postmortem analyzes. Therefore it is saved in the log file.
Config var name | Synopsis | Example Windows | Example Linux |
---|---|---|---|
UserAppData | Path where FreeCAD stores User Related application data. | C:\Documents and Settings\username\AppData\FreeCAD Short path : %APPDATA%\FreeCAD |
/home/username/.FreeCAD Short path : ~/.FreeCAD |
UserParameter | File where FreeCAD stores User Related application data. | C:\Documents and Settings\username\AppData\FreeCAD\user.cfg Short path : %APPDATA%\FreeCAD\user.cfg |
/home/username/.config/FreeCAD/user.cfg Short path : ~/.config/FreeCAD/user.cfg or $HOME/.config/FreeCAD/user.cfg |
SystemParameter | File where FreeCAD stores Application Related data. | C:\Documents and Settings\username\AppData\FreeCAD\system.cfg Short path : %APPDATA%\FreeCAD\system.cfg |
/home/username/.config/FreeCAD/system.cfg Short path : ~/.FreeCAD/system.cfg or $HOME/.FreeCAD/system.cfg |
UserHomePath | Home path of the current user | C:\Documents and Settings\username Short path : %USERPROFILE% |
/home/username Short path : ~ |
Note: For Linux distributions, an additional configuration file that relates to Qt may exist at path /home/username/.config/FreeCAD/FreeCAD.conf.
Config var name | Synopsis | Example |
---|---|---|
LoggingFile | 1 if the logging is switched on | 1 |
LoggingFileName | File name where the log is placed | C:\Documents and Settings\username\AppData\FreeCAD\FreeCAD.log |
RunMode | This indicates how the main loop will work. "Script" means that the given script is called and then exit. "Cmd" runs the command line interpreter. "Internal" runs an internal script. "Gui" enters the Gui event loop. "Module" loads a given python module. | "Cmd" |
FileName | Meaning depends on the RunMode | |
ScriptFileName | Meaning depends on the RunMode | |
Verbose | Verbosity level of FreeCAD | "" or "strict" |
OpenFileCount | Holds the number of files opened through command line arguments | "12" |
AdditionalModulePaths | Holds the additional Module paths given in the cmd line | "extraModules/" |
Config var name | Synopsis | Example Windows | Example Linux |
---|---|---|---|
AppHomePath | Path where FreeCAD is installed | c:/Progam Files/FreeCAD_0.19 | /user/local/FreeCAD_0.19 |
PythonSearchPath | Holds a list of paths which python search modules. This is at startup can change during execution | ||
AppTempPath | Path of the temporary directory. Can be given with TMPDIR environment variable, or with the |
/tmp/ (default) |
The table below shows the available information about the Build version. Most of it comes from the Subversion repository. This stuff is needed to exactly rebuild a version!
Config var name | Synopsis | Example |
---|---|---|
BuildVersionMajor | Major Version number of the Build. Defined in src/Build/Version.h.in | 0 |
BuildVersionMinor | Minor Version number of the Build. Defined in src/Build/Version.h.in | 7 |
BuildRevision | SVN Repository Revision number of the src in the Build. Generated by SVN | 356 |
BuildRevisionRange | Range of different changes | 123-356 |
BuildRepositoryURL | Repository URL | https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk/src |
BuildRevisionDate | Date of the above Revision | 2007/02/03 22:21:18 |
BuildScrClean | Indicates if the source was changed after checkout | Src modified |
BuildScrMixed | Src not mixed |
These Config entries are related to the branding mechanism of FreeCAD. See Branding for more details.
Config var name | Synopsis | Example |
---|---|---|
ExeName | Name of the build Executable file. Can differ from FreeCAD if a different main.cpp is used. | FreeCAD.exe |
ExeVersion | Over all Version shows up at start time | "0.19" |
AppIcon | Icon which is used for the Executable, shows in Application MainWindow. | "FCIcon" |
ConsoleBanner | Banner which is prompted in console mode | |
SplashPicture | Name of the Icon used for the Splash Screen | "FreeCADSplasher" |
SplashAlignment | Alignment of the Text in the Splash dialog | "Bottom" or "Left" |
SplashTextColor | Color of the splasher Text | "#000000" |
StartWorkbench | Name of the Workbench which get started automatically after Startup | "Part Design" |
HiddenDockWindow | List of dockwindows (separated by a semicolon) which will be disabled | "Property editor" |
From FreeCAD's Python console
Entries of the configuration set can be queried with the config var name (see tables above) from the Python console. For example:
>>> FreeCAD.ConfigGet("ExeVersion") '0.19'
If the name is not found, an empty string is returned.
From command line
Use the --get-config <config-var-name>
option to query a single name. Not all names are supported. For example:
FreeCAD --get-config ExeVersion
Use the --dump-config
option to get a list of names and their values. Not all names are supported.
From FreeCAD console
Start FreeCAD in console mode with --console
and query with Python code. For example:
$ FreeCAD --console [FreeCAD Console mode <Use Ctrl-D (i.e. EOF) to exit.>] >>> FreeCAD.ConfigGet("ExeVersion") '0.19' >>> exit()
For Linux (bash shell) you can modify the following command line to suit your needs:
$ FreeCAD --console <<EOF print( "FREECAD_USER_HOME: " + ( "not set" if ( os.environ.get('FREECAD_USER_HOME') is None ) else os.environ.get('FREECAD_USER_HOME') ) ) print( "UserHomePath: " + FreeCAD.ConfigGet("UserHomePath") ) exit() EOF
The following assumes that your desktop is configured such that you can launch FreeCAD from it. Depending on your Linux distribution and desktop environment, you may have to adapt the following steps:
Exec
.Windows
Put the FreeCAD executable, FreeCAD.exe, on the USB medium. Create a batch file, FreeCAD.bat, and put it into the same directory as FreeCAD.exe. Inside the batch file write:
set CURRENTDIR=%cd%
set FREECAD_USER_HOME=%CURRENTDIR%
start FreeCAD.exe -u FreeCAD/user.cfg -s FreeCAD/system.cfg --write-log
Or with FREECAD_USER_DATA
(see):
set CURRENTDIR="%cd%"
set FREECAD_USER_DATA=%CURRENTDIR%/..
start FreeCAD.exe -u %FREECAD_USER_DATA%/user.cfg -s %FREECAD_USER_DATA%/system.cfg
With the batch in the root of the USB medium:
set CURRENTDIR=%cd%
set FREECAD_USER_DATA=%CURRENTDIR%FreeCAD\
start %cd%FreeCAD\bin\FreeCAD.exe -u %FREECAD_USER_DATA%user.cfg -s %FREECAD_USER_DATA%system.cfg
Now double-click the batch file to start FreeCAD. (see)